﻿#region File Header

/* File Name    : FacebookQuestionManager.cs
 * Description  : Contains methods to manage Facebook questions
 * Log
 * Date             Author              Description
 * 09-Sep-2011      Robin Jome          Class is created
 */

#endregion

using FacebookAPI.Base;
using FacebookAPI.FacebookProperties;
using FacebookAPI.Objects;

namespace FacebookAPI.Managers
{
    public class FacebookQuestionManager
    {
        #region Methods

        public FacebookConnection<FacebookQuestion> GetQuestions(string objectId, string accessToken)
        {
            FacebookManager mgr = new FacebookManager();
            return mgr.GetConnectionObject<FacebookQuestion>(mgr.GetUrl(objectId, FacebookConnections.Questions, accessToken));
        }

        #endregion

        #region Connections

        public FacebookConnection<QuestionOption> GetOptions(string questionId, string accessToken)
        {
            FacebookManager mgr = new FacebookManager();
            return mgr.GetConnectionObject<QuestionOption>(mgr.GetUrl(questionId, FacebookConnections.Options, accessToken));
        }

        public FacebookConnection<FacebookBaseObject> GetVoters(string questionOptionId, string accessToken)
        {
            FacebookManager mgr = new FacebookManager();
            return mgr.GetConnectionObject<FacebookBaseObject>(mgr.GetUrl(questionOptionId, FacebookConnections.Votes, accessToken));
        }

        #endregion
    }
}
